/**
 * @ShapeUtils.as
 *
 * @author sodaChen mail:asframe@qq.com
 * @version 1.0
 * <br>Copyright (C), 2013 asFrame.com
 * <br>This program is protected by copyright laws.
 * <br>Program Name:RPGMakerXP
 * <br>Date:2017-1-22
 */
package com.asframe.utils
{
	import flash.display.BitmapData;
	import flash.display.Shape;

	/**
	 *
	 * @author sodaChen
	 * Date:2017-1-22
	 */
	public class ShapeUtils
	{
		private static const shape:Shape = new Shape();
		public function ShapeUtils()
		{
		}
		/**
		 * 绘制背景框
		 * @param width
		 * @param height
		 * @param bitmapData
		 * @param color
		 *
		 */
		public static function drawBackground(width:int,height:int,color:uint = 0x000000):BitmapData
		{
			shape.graphics.clear();
			shape.graphics.beginFill(color);
			shape.graphics.drawRect(0,0,width,height);
			shape.graphics.endFill();
			//draw
			var bitmapData:BitmapData = new BitmapData(width,height,true,0);
			bitmapData.draw(shape);
			return bitmapData;
		}
	}
}